﻿using UnityEngine;
using System.Collections;

public class LaneManager : MonoBehaviour
{
	[HideInInspector]
	public static LaneManager instance; // static allows access from anywhere

	public Transform[] Lanes;

	void Awake()
	{
		instance = this;
	}

	public Vector3 MoveTo(int lane)
	{
		Vector3 newLocal = new Vector3(0,0,0);

		for(int index = 0; index < Lanes.Length; index++)
		{
			if (index == lane)
			{
				newLocal = Lanes[index].position;
			}
		}
		Vector3 upLoc = new Vector3(newLocal.x, newLocal.y, 0);

		return upLoc;
	}
}